using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WoWAddonRefresh.Entities;

namespace WoWAddonRefresh {
    public partial class FormOptions : Form {
        public FormOptions() {
            InitializeComponent();
        }

        private Credentials credo = null;

        public FormOptions(ref Credentials credentials) {
            InitializeComponent();
            credo = credentials;
            cbMakeBackup.Checked = credentials.MakeBackup;
            cb_nopatch.Checked = credentials.AddNopatch;
            cb_patch.Checked = credentials.TryContiniously;
            cb_save.Checked = credentials.SaveCredentials;
            cbDeleteBefore.Checked = false;
        }

        private void cb_patch_CheckedChanged(object sender, EventArgs e) {
            credo.TryContiniously = cb_patch.Checked;
        }

        private void cb_backup_CheckedChanged(object sender, EventArgs e) {
            credo.MakeBackup = cbMakeBackup.Checked;
        }

        private void cb_nopatch_CheckedChanged(object sender, EventArgs e) {
            credo.AddNopatch = cb_nopatch.Checked;
        }

        private void cbDeleteBefore_CheckedChanged(object sender, EventArgs e) {
            cbDeleteBefore.Checked = false;
        }

        private void cb_save_CheckedChanged(object sender, EventArgs e) {
            credo.SaveCredentials = cb_save.Checked;
        }
    }
}